package com.gk.carshopsys.utils;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.gk.carshopsys.pojo.Car;
import com.gk.carshopsys.pojo.Part;


public class PartConverter implements Converter<Part> {

    @Override
    public Class supportJavaTypeKey() {
        return Part.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public WriteCellData<?> convertToExcelData(Part value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return new WriteCellData(value.getFactory()+value.getPname()+value.getSource());
    }
}
